#ifndef __SMC_H__
#define __SMC_H__

#include "main.h"

typedef struct
{
	float k;
	float s;
	int32_t rate;
    float FILTER_ALPHA;
	float output_max;
	float recent_error;
	float last_error;
	float integral;
	float integral_max;
	float output;
    float filtered_output;
}smc_controller;

void smc_controller_create(smc_controller* smc,float k,int32_t rate,float output_max);
void smc_calculate(smc_controller * smc);
void smc_error_input(smc_controller * smc, float error);
float smc_output(smc_controller * smc);

#endif
